package com.atguigu.spzx.service.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author MikeCoder
 * @create 2023-12-0419:46
 * @description:
 * @verson:
 */

public class Knife4jConfig {

    @Bean//创建一个api接口的分组
    public GroupedOpenApi adminApi(){
        return GroupedOpenApi.builder()
                .group("admin-api")//分组名称
                .pathsToMatch("/admin/**")//接口请求路径规则
                .build();
    }

    @Bean//自定义接口信息
    public OpenAPI customOpenAPI(){
        return new OpenAPI()
                .info(new Info()
                .title("商品甄选API接口文档")
                .version("1.0")
                .description("商品甄选API接口文档")
                .contact(new Contact().name("atguigu")));
    }
}
